package org.vidyakiran.app.client.view;

import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.FlexTable;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.ListBox;
import com.google.gwt.user.client.ui.Panel;
import com.google.gwt.user.client.ui.PopupPanel;
import com.google.gwt.user.client.ui.TextBox;

public class PostNewActivityPopUp extends PopupPanel {

	private FlexTable mainActivityFlexTable;

	private Label activityLabel;

	private Label activityPreferenceLabel1;

	private Label activityPreferenceLabel2;

	private Label activityPreferenceLabel3;
	
	private TextBox activityPreferenceTextBox1;
	private TextBox activityPreferenceTextBox2;
	private TextBox activityPreferenceTextBox3;

	private Label TimeLabel;
	
	private TextBox timePreferenceStartTextbox1;
	private TextBox timePreferenceStartTextbox2;
	private TextBox timePreferenceStartTextbox3;
	
	private ListBox timePreferenceStartPeriodListbox1;
	private ListBox timePreferenceStartPeriodListbox2;
	private ListBox timePreferenceStartPeriodListbox3;
	
	private TextBox timePreferenceEndTextbox1;
	private TextBox timePreferenceEndTextbox2;
	private TextBox timePreferenceEndTextbox3;
	
	private ListBox timePreferenceEndPeriodListbox1;
	private ListBox timePreferenceEndPeriodListbox2;
	private ListBox timePreferenceEndPeriodListbox3;

	private Label locationLabel;

	private Label locationPreferenceLabel1;

	private Label locationPreferenceLabel2;

	private Label locationPreferenceLabel3;
	
	private TextBox locationPreferenceTextBox1;
	private TextBox locationPreferenceTextBox2;
	private TextBox locationPreferenceTextBox3;

	private Button okButton;
	


	private Button cancelButton;
	
	private static String AM_TIME ="am";
	private static String PM_TIME ="pm";
	

	

	public PostNewActivityPopUp() {
		mainActivityFlexTable = new FlexTable();
		activityLabel = new Label("Activities");
		activityPreferenceLabel1 = new Label("Activity Pref 1");
		activityPreferenceLabel2 = new Label("Activity Pref 2");
		activityPreferenceLabel3 = new Label("Activity Pref 3");
		
		TimeLabel = new Label("Time");
		timePreferenceStartTextbox1 = new TextBox();
		timePreferenceStartTextbox2 = new TextBox();
		timePreferenceStartTextbox3 = new TextBox();
		
		timePreferenceEndTextbox1 = new TextBox();
		timePreferenceEndTextbox2 = new TextBox();
		timePreferenceEndTextbox3 = new TextBox();
		
		timePreferenceStartPeriodListbox1 = new ListBox();
		timePreferenceStartPeriodListbox1.addItem(AM_TIME);
		timePreferenceStartPeriodListbox1.addItem(PM_TIME);
		
		timePreferenceStartPeriodListbox2 = new ListBox();
		timePreferenceStartPeriodListbox2.addItem(AM_TIME);
		timePreferenceStartPeriodListbox2.addItem(PM_TIME);
		
		timePreferenceStartPeriodListbox3 = new ListBox();
		timePreferenceStartPeriodListbox3.addItem(AM_TIME);
		timePreferenceStartPeriodListbox3.addItem(PM_TIME);
		
		timePreferenceEndPeriodListbox1 = new ListBox();
		timePreferenceEndPeriodListbox1.addItem(AM_TIME);
		timePreferenceEndPeriodListbox1.addItem(PM_TIME);
		
		timePreferenceEndPeriodListbox2 = new ListBox();
		timePreferenceEndPeriodListbox2.addItem(AM_TIME);
		timePreferenceEndPeriodListbox2.addItem(PM_TIME);
		
		timePreferenceEndPeriodListbox3 = new ListBox();
		timePreferenceEndPeriodListbox3.addItem(AM_TIME);
		timePreferenceEndPeriodListbox3.addItem(PM_TIME);
		
		locationLabel = new Label("Location");
		locationPreferenceLabel1 = new Label("Loc. Pref. 1");
		locationPreferenceLabel2 = new Label("Loc. Pref. 2");
		locationPreferenceLabel3 = new Label("Loc. Pref. 3");
		
		
		locationPreferenceTextBox1 = new TextBox();
		locationPreferenceTextBox2 = new TextBox();
		locationPreferenceTextBox3 = new TextBox();
		
		okButton = new Button("OK");
		cancelButton = new Button("Cancel");
		
		this.add(createActivityPopup());
	}

	private Panel createActivityPopup(){
		//mainActivityFlexTable.setWidget(0, 0, activityLabel);
		//mainActivityFlexTable.getFlexCellFormatter().setColSpan(0, 0, 2);
		mainActivityFlexTable.setWidget(1, 0, activityPreferenceLabel1);
		mainActivityFlexTable.setWidget(1, 1, activityPreferenceTextBox1);
		mainActivityFlexTable.setWidget(2, 0, activityPreferenceLabel2);
		mainActivityFlexTable.setWidget(2, 1, activityPreferenceTextBox2);
		mainActivityFlexTable.setWidget(3, 0, activityPreferenceLabel3);
		mainActivityFlexTable.setWidget(3, 1, activityPreferenceTextBox3);
		
		//mainActivityFlexTable.setWidget(0, 1, TimeLabel);
		//mainActivityFlexTable.getFlexCellFormatter().setColSpan(0, 1, 4);
		mainActivityFlexTable.setWidget(1, 2, timePreferenceStartTextbox1);
		mainActivityFlexTable.setWidget(1, 3, timePreferenceStartPeriodListbox1);
		mainActivityFlexTable.setWidget(1, 4, timePreferenceEndTextbox1);
		mainActivityFlexTable.setWidget(1, 5, timePreferenceEndPeriodListbox1);
		
		mainActivityFlexTable.setWidget(2, 2, timePreferenceStartTextbox2);
		mainActivityFlexTable.setWidget(2, 3, timePreferenceStartPeriodListbox2);
		mainActivityFlexTable.setWidget(2, 4, timePreferenceEndTextbox2);
		mainActivityFlexTable.setWidget(2, 5, timePreferenceEndPeriodListbox2);
		
		mainActivityFlexTable.setWidget(3, 2, timePreferenceStartTextbox3);
		mainActivityFlexTable.setWidget(3, 3, timePreferenceStartPeriodListbox3);
		mainActivityFlexTable.setWidget(3, 4, timePreferenceEndTextbox3);
		mainActivityFlexTable.setWidget(3, 5, timePreferenceEndPeriodListbox3);
		
		
		mainActivityFlexTable.setWidget(4, 0, locationLabel);
		mainActivityFlexTable.getFlexCellFormatter().setColSpan(4, 0, 2);
		mainActivityFlexTable.setWidget(5, 0, locationPreferenceLabel1);
		mainActivityFlexTable.setWidget(5, 1, locationPreferenceTextBox1);
		mainActivityFlexTable.setWidget(6, 0, locationPreferenceLabel2);
		mainActivityFlexTable.setWidget(6, 1, locationPreferenceTextBox2);
		mainActivityFlexTable.setWidget(7, 0, locationPreferenceLabel3);
		mainActivityFlexTable.setWidget(7, 1, locationPreferenceTextBox3);

		
		mainActivityFlexTable.setWidget(8, 0, okButton);
		mainActivityFlexTable.setWidget(8, 1, cancelButton);
		
		
		
		
		return mainActivityFlexTable;
	}

	public FlexTable getMainActivityFlexTable() {
		return mainActivityFlexTable;
	}

	public Label getActivityLabel() {
		return activityLabel;
	}

	public Label getActivityPreferenceLabel1() {
		return activityPreferenceLabel1;
	}

	public Label getActivityPreferenceLabel2() {
		return activityPreferenceLabel2;
	}

	public Label getActivityPreferenceLabel3() {
		return activityPreferenceLabel3;
	}

	public TextBox getActivityPreferenceTextBox1() {
		return activityPreferenceTextBox1;
	}

	public TextBox getActivityPreferenceTextBox2() {
		return activityPreferenceTextBox2;
	}

	public TextBox getActivityPreferenceTextBox3() {
		return activityPreferenceTextBox3;
	}

	public Label getTimeLabel() {
		return TimeLabel;
	}

	public TextBox getTimePreferenceStartTextbox1() {
		return timePreferenceStartTextbox1;
	}

	public TextBox getTimePreferenceStartTextbox2() {
		return timePreferenceStartTextbox2;
	}

	public TextBox getTimePreferenceStartTextbox3() {
		return timePreferenceStartTextbox3;
	}

	public ListBox getTimePreferenceStartPeriodListbox1() {
		return timePreferenceStartPeriodListbox1;
	}

	public ListBox getTimePreferenceStartPeriodListbox2() {
		return timePreferenceStartPeriodListbox2;
	}

	public ListBox getTimePreferenceStartPeriodListbox3() {
		return timePreferenceStartPeriodListbox3;
	}

	public TextBox getTimePreferenceEndTextbox1() {
		return timePreferenceEndTextbox1;
	}

	public TextBox getTimePreferenceEndTextbox2() {
		return timePreferenceEndTextbox2;
	}

	public TextBox getTimePreferenceEndTextbox3() {
		return timePreferenceEndTextbox3;
	}

	public ListBox getTimePreferenceEndPeriodListbox1() {
		return timePreferenceEndPeriodListbox1;
	}

	public ListBox getTimePreferenceEndPeriodListbox2() {
		return timePreferenceEndPeriodListbox2;
	}

	public ListBox getTimePreferenceEndPeriodListbox3() {
		return timePreferenceEndPeriodListbox3;
	}

	public Label getLocationLabel() {
		return locationLabel;
	}

	public Label getLocationPreferenceLabel1() {
		return locationPreferenceLabel1;
	}

	public Label getLocationPreferenceLabel2() {
		return locationPreferenceLabel2;
	}

	public Label getLocationPreferenceLabel3() {
		return locationPreferenceLabel3;
	}

	public TextBox getLocationPreferenceTextBox1() {
		return locationPreferenceTextBox1;
	}

	public TextBox getLocationPreferenceTextBox2() {
		return locationPreferenceTextBox2;
	}

	public TextBox getLocationPreferenceTextBox3() {
		return locationPreferenceTextBox3;
	}

	public Button getOkButton() {
		return okButton;
	}

	public Button getCancelButton() {
		return cancelButton;
	}

	public static String getAM_TIME() {
		return AM_TIME;
	}

	public static String getPM_TIME() {
		return PM_TIME;
	}
}
